package com.ceo.auth.jwt;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author uto_dev_008
 * @desc
 * @since 2023/6/2 13:55
 * Copyright (c)  All rights reserved
 */

@ConfigurationProperties(prefix = "config.jwt")
@Component
public class JwtConfig {
    /**
     * 过期时间
     */
    private long expire;

    /**
     * 密钥
     */
    private String secret;

    /**
     * 盐
     */
    private String salt;

    public long getExpire() {
        return expire;
    }

    public void setExpire(long expire) {
        this.expire = expire;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    @Bean("jwtInterceptor")
    public JwtChainIntercepter jwtIntercepter() {
        return new JwtChainIntercepter();
    }

}
